<?
//Import Classes
	require_once('classes/session.php');
	require_once('classes/sql_wtc.php');
	require_once('classes/functions.php');
	require_once('classes/country.php');
	require_once('classes/code.php');
	
	$myDB = new MySQL_class();
	$myDB->Create();

//Functions	
	
	$menuhtml		= buildMenu($cat_lev,$category,$cat_par,'product.php');

	if (isset($_POST['status'])) $status=$_POST['status'];
	else if (isset($_GET['status'])) $status=$_GET['status'];
	
	if (isset($_POST['rrNo'])) $rrNo=$_POST['rrNo'];
	else if (isset($_GET['rrNo'])) $rrNo=$_GET['rrNo'];
	else $rrNo='0';

	if (isset($_POST['respCode'])) $rcd=$_POST['respCode'];
	else if (isset($_GET['respCode'])) $rcd=$_GET['respCode'];
	else $rcd=0;

	if (!$rrNo) $rrNo=0;

	if (isset($_POST['orderid'])) $orderid=$_POST['orderid'];
	else if (isset($_GET['orderid'])) $orderid=$_GET['orderid'];

	if (isset($_GET['method'])) $method=$_GET['method'];
	else $method='VISA';

	$back='<a href="check_out_payment_details.php"><img src="images/en_01.gif" border="0" align="absmiddle"></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="check_out_payment_details.php?action=transfer&method=credit card"><img src="images/en_02.gif" border="0" align="absmiddle"></a>&nbsp;&nbsp;&nbsp;&nbsp;';

	if ($status) {
		switch ($status) {
			case 'AP':
					$order_status	= "Confirmed";
					$msg			= "<p>Thank you for your order ! &nbsp;&nbsp;Your order number is : <b>".str_pad($orderid,5,'0',STR_PAD_LEFT)."</b></p><p>An e-Receipt will be sent to you by email. Please print and bring it when you pick the goods by yourself.</p>";
					$back			= '';
					break;
			case 'CC':
					$order_status	= "Cancelled";
					$msg			= "<p><font color=\"#ff3333\">".getMessage($rcd,'CC')."</fon></p>";
					break;
			case 'RJ':
					$order_status	= "Cancelled";
					$msg			= "<p><font color=\"#ff3333\">".getMessage($rcd,'RJ')."</fon></p>";
					break;
			case 'TO':
					$order_status	= "Cancelled";
					$msg			= "<p><font color=\"#ff3333\">".getMessage($rcd,'TO')."</fon></p>";
					break;
		}
	$sql="select order_status from cus_order where no=$orderid";
	$myDB->Query($sql);
	$rec=mysql_fetch_object($myDB->result);
	if ($rec->order_status!='Confirmed') {

//update Order status		
		//$sql	= "update cus_order set order_status='$order_status',pay_method='$method',trans_no=".$rrNo.",respcode = '$rcd' where no=".$orderid;
		$sql	= "update cus_order set order_status='$order_status',trans_no=".$rrNo.",respcode = '$rcd' where no=".$orderid;
		//$sql	= "update cus_order set order_status='$order_status',trans_no=".$rrNo.",respcode = '$rcd' where no=".$orderid;
		$myDB->Query($sql);

//update stock
		$proid='-1';

			$_SESSION['oid']=NULL;	
			unset($_SESSION['oid']);

		if ($order_status == 'Confirmed') {
//Clear session
			$_SESSION['view']=NULL;
			$_SESSION['cart']=NULL;
			$_SESSION['order']=NULL;
			unset($_SESSION['view']);
			unset($_SESSION['cart']);
			unset($_SESSION['order']);
//update transaction
			$sql="update pro_transaction set cancelled=0 where orderno=$orderid ;";
			$myDB->Query($sql);

			$sql="select c.pro_name,c.pro_code,c.qty,c.unit_price,b.id,b.weight from cus_order_sub as c,pro_basic as b where b.code=c.pro_code and c.no=".$orderid;
			$myDB->Query($sql);
			if ($res=$myDB->result) {
				$i=0;
				while ($rec=mysql_fetch_object($res)){
					$myview[$i][0]	= $rec->id;
					$myview[$i][1]	= $rec->pro_name;
					$myview[$i][2]	= $rec->pro_code;
					$myview[$i][3]	= $rec->weight;
					$myview[$i][4]	= $rec->unit_price;
					$myview[$i][5]	= $rec->qty;
					$i++;
					$proid.=','.$rec->id;
					
					$sql="update pro_basic set stock=stock-".$rec->qty." where code='".$rec->pro_code."';";
					$myDB->Query($sql);
				}
			}

//mail e-recipient
		$sql="select * from cus_order where no=".$orderid;
		$myDB->Query($sql);
		$rec=mysql_fetch_object($myDB->result);
		$html='';
		
		if ($rec->claim!='0') {
		$sql1="select * from med_shipping where id=".$rec->claim;
		$myDB->Query($sql1);
		$rec1=mysql_fetch_object($myDB->result);
		$claim = '<font color="#0000FF" size="2" face="Arial, Helvetica, sans-serif">'.$rec1->region.' , Redemption Centre</font>';
		$claim_addr = '<font color="#0000FF">'.nl2br($rec1->claim_addr_en).'<br>'.nl2br($rec1->claim_msg).'</font>';
		$jesse= 'Redemption Centre Infomation :';
		$jesse2= 'Redemption Surcharges :';
		}
		else {
		$claim = '<font color="#0000FF" size="2" face="Arial, Helvetica, sans-serif">'.$rec->shipping_region.' , '.$rec->shipping_carrier.'</font></td>';
		$claim_addr = '<font color="#0000FF">'.nl2br($rec->billing_address).'</font>';
		$jesse= 'Delivery Address :';
		$jesse2= 'Shipping Charge :';
		}
		
		for ($i=0;$i<count($myview);$i++)
			$html.='<tr><td>['.$myview[$i][2].'] '.$myview[$i][1].'</td><td>'.$myview[$i][5].'</td><td align="right">'.number_format($myview[$i][4],2).'</td><td align="right">'.number_format(($myview[$i][4]*$myview[$i][5]),2).'</td></tr>';
		$charge=getBilling($myview,$rec->shipping_region,$rec->shipping_carrier);
		$member_name = $rec->member_name;
		$purchase_date = date('Y-m-d H:i:s',$rec->purchase_date);
		$html='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Jonesky</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
<style type="text/css">
body {font-size: 10pt; font-family: Arial }
td {font-size: 10pt; font-family: Arial }
</style>
</head>
<body bgcolor="#FFFFFF">
<table width="600" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td align="right"><table width="180" border="0" cellpadding="1" cellspacing="0">
  <tr>
    <td bgcolor="#000000"><table width="100%" border="0" cellpadding="1" cellspacing="0" bgcolor="#FFFFFF">
        <tr>
                <td align="center"><font size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong>Jonesky  
                  Limited </strong></font></td>
        </tr>
      </table></td>
  </tr>
</table></td>
  </tr>
</table>
<br>
<font size="2" face="Arial, Helvetica, sans-serif"><img src="http://jonesky.imaker.com.hk/pictures/e-receipt.jpg?'.rand(0, 9999).'"><br>
Dear <font color="#0000FF">'.$rec->member_name.'</font>, </font><font face="Arial, Helvetica, sans-serif"> 
<p><font size="2">Thank you for your order.<br>
  This email confirms receipt of your order<font color="#0000FF"> '.str_pad($rec->no,5,'0',STR_PAD_LEFT).'</font> 
  taken on <font color="#0000FF">'.date('Y-m-d H:i:s',$rec->purchase_date).'</font></font></p>
<p><font size="2">The order consists of the following:</font></p>
</font> 
<table width="600" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="341"><strong><font size="2" face="Arial, Helvetica, sans-serif">Item</font></strong></td>
    <td width="57"><div align="center"><strong><font size="2" face="Arial, Helvetica, sans-serif">Qty</font></strong></div></td>
    <td width="120"><div align="right"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Price</strong></font></div></td>
    <td width="82"><div align="right"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Amount</strong></font></div></td>
  </tr>
  <tr> 
    <td colspan="4"> <hr size="1"> </td>
  </tr>
  <tr> 
    <td><font size="2" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
    <td><font size="2" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
    <td><div align="right"><strong><font size="1" face="Arial, Helvetica, sans-serif">HKD</font></strong></div></td>
    <td><div align="right"><strong><font size="1" face="Arial, Helvetica, sans-serif">HKD</font></strong></div></td>
  </tr>'.$html.'
  <tr> 
    <td colspan="4"> <hr size="1"> </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><div align="right"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Sub 
        Total :</strong></font></div></td>
    <td align="right">'.number_format($charge[0],2).'</td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><div align="right"><font size="2" face="Arial, Helvetica, sans-serif"><strong>'.$jesse2.'</strong></font></div></td>
    <td align="right">'.number_format($rec->shippingfee,2).'</td>
  </tr>
  <tr> 
    <td><font size="2" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
    <td><font size="2" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
    <td><div align="right"><strong><font size="2" face="Arial, Helvetica, sans-serif">Total 
        :</font></strong></div></td>
    <td><div align="right"><font size="2" face="Arial, Helvetica, sans-serif">'.number_format(($charge[0]+$rec->shippingfee),2).'</font></div></td>
  </tr>
</table>
<br>
<br>
<table width="601" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><strong><font size="2" face="Arial, Helvetica, sans-serif">Delivery Region / Method :</font></strong><br>
      '.$claim.'
	  </td>
  </tr>
  <tr> 
    <td><hr size="1"></td>
  </tr>
  <tr> 
    <td width="601"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Member Registration Address :</strong><br>
      <font color="#0000FF">'.nl2br($rec->recipient_address).'</font></td>
  </tr>
  <tr> 
    <td><hr size="1"></td>
  </tr>
  <tr> 
    <td>
	<font size="2" face="Arial, Helvetica, sans-serif"><strong>'.$jesse.'</strong><br>
      '.$claim_addr.'
	  </td>
  </tr>
  <tr> 
    <td height="24"><hr size="1"></td>
  </tr>
  <tr> 
    <td height="22"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Payment 
      received by :<br>
      </strong><font color="#0000FF">'.$method.'</font><br>
  </tr>
  <tr> 
    <td><br>
      <br></td>
  </tr>
  <tr> 
    <td><font face="Arial, Helvetica, sans-serif"><font size="2"><br>
      <font face="Arial, Helvetica, sans-serif"> If you want to get more, please 
      visit <a href="http://jonesky.imaker.com.hk">our website</a>.</font> 
      </font><font size="2" face="Arial, Helvetica, sans-serif"> </font></font></td>
  </tr>
</table>
<p>&nbsp;</p><p><font size="2" face="Arial, Helvetica, sans-serif"><strong>Jonesky Limited</strong><br>
  Unit 1201, 1205-8, 12/F Westlands Centre,<br>
  20 Westlands Road<br>
  Quarry Bay<br>
  Hong Kong<br>
  Tel: 2561-8172<br>
  Fax:2565-9326<br>
  <a href="http://www.comicsworld.com">www.comicsworld.com</a></font></p>
<p>&nbsp;</p>
<p>&nbsp; </p>
</body>
</html>';

	$tomail[0]='"'.$rec->member_name.'" <'.$rec->member_email.'>';
	$sql="select name,email from user_profile where alert01='y'";
	$myDB->Query($sql);
	$i=1;
	if ($res=$myDB->result) {
		while ($rec=mysql_fetch_object($res)) {
			$tomail[$i]='"'.$rec->name.'" <'.$rec->email.'>';
			$i++;
		}
	}

	for ($i=0;$i<count($tomail);$i++)
		myMail('Jonesky Limited - online shopping',$html,'',$tomail[$i]);

//check for out of stock			
			$sql="select * from pro_basic where id in ($proid) and stock<=0";
			$myDB->Query($sql);
			if (($res=$myDB->result)&&$myDB->rows) {
				$html='';
				while ($rec=mysql_fetch_object($res)){
					$html.='<tr><td>'.$rec->code.'</td><td>'.$rec->name.'<br>'.$rec->brand.'</td><td align="right">'.$rec->stock.'</td></tr>';
				}
				$sql="select name,email from user_profile where alert03='y'";
				$myDB->Query($sql);
				if ($res=$myDB->result) {
					$tomail='';
					while ($rec=mysql_fetch_object($res)) {
						if ($tomail) $tomail.=",";
						$tomail.='"'.$rec->name.'" <'.$rec->email.'>';
					}
				}
				$html='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Out of stock Alert</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<style type="text/css">
body {font-size: 10pt; font-family: Arial }
td {font-size: 10pt; font-family: Arial }
</style>
</head>
<body bgcolor="#FFFFFF">
<table width="600" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td align="right"><table width="180" border="0" cellpadding="1" cellspacing="0">
  <tr>
    <td bgcolor="#000000"><table width="100%" border="0" cellpadding="1" cellspacing="0" bgcolor="#FFFFFF">
        <tr>
                <td align="center"><font size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong>Jonesky 
                  Limited </strong></font></td>
        </tr>
      </table></td>
  </tr>
</table></td>
  </tr>
</table>
<br>
<font size="2" face="Arial, Helvetica, sans-serif"><br>
Dear all,<br>
<p>The following items are out of stock after receiving the order '.str_pad($orderid,5,'0',STR_PAD_LEFT).'<br><br>

Customer : '.$member_name.'<br> 
Order No. : '.str_pad($orderid,5,'0',STR_PAD_LEFT).'<br>
Order Date : '.$purchase_date.'<br>
</p>
</font> 
<table width="600" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="60"><strong><font size="2" face="Arial, Helvetica, sans-serif">Code</font></strong></td>
    <td width="400"><div align="center"><strong><font size="2" face="Arial, Helvetica, sans-serif">Name</font></strong></div></td>
    <td width="100"><div align="right"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Current Stock</strong></font></div></td>
  </tr>
'.$html.'
</table>
<br>
<br>
<p>&nbsp;</p>
<p><font size="2" face="Arial, Helvetica, sans-serif"><strong>Jonesky Limited</strong><br>
  Unit 1201, 1205-8, 12/F Westlands Centre,<br>
  20 Westlands Road<br>
  Quarry Bay<br>
  Hong Kong<br>
  Tel: 2561-8172<br>
  Fax:2565-9326<br>
  <a href="http://www.comicsworld.com">www.comicsworld.com </a></font></p>
<p>&nbsp; </p>
</body>
</html>';
				myMail('Out of stock Alert',$html,'',$tomail);
			}	
			$sql="select * from pro_basic where id in ($proid) and stock<=reorder";
			$myDB->Query($sql);
			if (($res=$myDB->result)&&$myDB->rows) {
				$html='';
				while ($rec=mysql_fetch_object($res)){
					$html.='<tr><td>'.$rec->code.'</td><td>'.$rec->name.'<br>'.$rec->brand.'</td><td align="right">'.$rec->stock.'</td></tr>';
				}
				$sql="select name,email from user_profile where alert02='y'";
				$myDB->Query($sql);
				if ($res=$myDB->result) {
					$tomail='';
					while ($rec=mysql_fetch_object($res)) {
						if ($tomail) $tomail.=",";
						$tomail.='"'.$rec->name.'" <'.$rec->email.'>';
					}
				}
				$html='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Re-Order Alert</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<style type="text/css">
body {font-size: 10pt; font-family: Arial }
td {font-size: 10pt; font-family: Arial }
</style>
</head>
<body bgcolor="#FFFFFF">
<table width="600" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td align="right"><table width="180" border="0" cellpadding="1" cellspacing="0">
  <tr>
    <td bgcolor="#000000"><table width="100%" border="0" cellpadding="1" cellspacing="0" bgcolor="#FFFFFF">
        <tr>
                <td align="center"><font size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong>Jonesky 
                  Limited </strong></font></td>
        </tr>
      </table></td>
  </tr>
</table></td>
  </tr>
</table>
<br>
<font size="2" face="Arial, Helvetica, sans-serif"><br>
Dear all,<br>
<p>The following items need to re-order after receiving the order '.str_pad($orderid,5,'0',STR_PAD_LEFT).'<br><br>

Customer : '.$member_name.'<br> 
Order No. : '.str_pad($orderid,5,'0',STR_PAD_LEFT).'<br>
Order Date : '.$purchase_date.'<br>
</p>
</font> 
<table width="600" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="60"><strong><font size="2" face="Arial, Helvetica, sans-serif">Code</font></strong></td>
    <td width="400"><div align="center"><strong><font size="2" face="Arial, Helvetica, sans-serif">Name</font></strong></div></td>
    <td width="100"><div align="right"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Current Stock</strong></font></div></td>
  </tr>
'.$html.'
</table>
<br>
<br>
<p>&nbsp;</p>
<p><font size="2" face="Arial, Helvetica, sans-serif"><strong>Jonesky Limited</strong><br>
  Unit 1201, 1205-8, 12/F Westlands Centre,<br>
  20 Westlands Road<br>
  Quarry Bay<br>
  Hong Kong<br>
  Tel: 2561-8172<br>
  Fax:2565-9326<br>
  <a href="http://www.comicsworld.com">www.comicsworld.com </a></font></p>
<p>&nbsp; </p>
</body>
</html>';
				myMail('Re-order Alert',$html,'',$tomail);
			}			
		}
	}
	}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>Jonesky eShopping</title>

<link href="css/main.css" rel="stylesheet" type="text/css">

</head>

<body>
<table width="770" align="center" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="85" align="center" valign="top">
	  <table width="100%" height="84"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="205" rowspan="3" align="center" valign="middle" background="images/index_LOGO_t1-1.gif">&nbsp;</td>
          <td width="1" rowspan="3"></td>
          <td height="57" align="right" background="images/index_CH_t1-2-1.gif"><table width="430" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="425" height="34" align="right" background="images/index_CH_t1-2-1-2.gif"><a href="../Jonesky_CH/order_confirm.php?orderid=<?=$orderid?>&method=<?=$method?>&status=<?=$status?>&rrNo=<?=$rrNo?>"><img src="images/jonesky_chinese.gif" border="0"></a></td>
			  <td width="5"></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td height="1"></td>
        </tr>
        <tr>
          <td height="26" align="right" background="images/index_SVC_t1-2-2.gif"><table width="" height="18" border="0" cellpadding="0" cellspacing="0">
            <tr align="left" valign="middle">
              <td width="115"><a class=s3 href="shipping_charge_list.php">- Shipping Charge </a></td>
              <td width="75"><a class=s3 href="view_cart.php">- View Cart </a></td>
              <td width="75"><a class=s3 href="check_out_delivery_details.php">- Check Out</a> </td>
              <td width="155"><a class=s3 href="claim.php">- Redemption Centre Info </a></td>
            </tr>
          </table></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td height="111" bgcolor="#FF0000"><img src="images/<?=randomBanner()?>" width="770" height="111"></td>
  </tr>
    <tr>
    <td height="1"></td>
  </tr>
  <tr>
    <td height="475" valign="top"><table width="100%" height="475"  border="0" cellpadding="0" cellspacing="0" class="mytd">
      <tr>
        <td height="31"><table width="100%" height="31"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="710" background="images/red_navigate.gif"><table width="100%" height="31"  border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="43" align="center"><a class=s3 href="index_eng.php">Home</a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="59" align="center"><a class=s3 href="about_us.php">About us </a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="86" align="center"><a class=s3 href="new_products.php">New Products </a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="68" align="center"><a class=s3 href="promotion.php">Promotion</a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="33" align="center"><a class=s3 href="faq.php">FAQ</a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="130" align="center"><a class=s3 href="terms_and_condition.php">Terms and Conditions</a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="83" align="center"><a class=s3 href="return_policy.php">Return Policy </a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="93" align="center"><a class=s3 href="delivery_policy.php">Delivery Policy</a> </td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="71" align="center"><a class=s3 href="contact_us.php">Contact us </a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="35" align="center"><a class=s3 href="news.php">News</a></td>
              </tr>
            </table></td>
            <td><img src="images/red_navigate_right.gif" width="36" height="31"></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="381"><table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="4"></td>
            <td width="192" valign="top">
			<table border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="2" bgcolor="#FFFFFF"></td>
                <td width="184" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="2" bgcolor="#FFFFFF"></td>
                  </tr>
                  <tr>
                    <td height="28"><img src="images/products0.gif" width="184" height="28"></td>
                  </tr>
                  <tr>
                    <td height="2" bgcolor="#FFFFFF"></td>
                  </tr>
                  <tr>
                    <td height="80" background="images/products3.jpg">
                      <form name="searchbox" action="product_search_result.php" method="post"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;<a class=s2>Keywords</a></td>
                        </tr>
                        <tr>
                          <td>&nbsp;&nbsp;&nbsp;<input name="search" type="text" class="text" id="search" size="20"></td>
                        </tr>
                        <tr>
                          <td height="28">&nbsp;&nbsp;&nbsp;<input name="submit" type="submit" class="button" id="submit" onClick="MM_validateForm('search','','R');return document.MM_returnValue" value="Search"></td>
                        </tr>
                      </table></form>
</td>
                  </tr>
				<?=$menuhtml?>
                </table></td>
                <td width="6" valign="top" background="images/index_SVC_t1-2-2.jpg">&nbsp;</td>
              </tr>
              <tr>
                <td width="2" bgcolor="#FFFFFF"></td>
                <td height="12" background="images/Pro_Search_bottom.gif">&nbsp;</td>
                <td width="6"><img src="images/Pro_Search_circle.gif" width="6" height="12"></td>
              </tr>
            </table>
			</td>
            <td width="574" valign="top"><div style="padding:10px 15px;">

			      <br>
      <br>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="s4">

			<?=$msg?>
            <p>&nbsp;</p>
            <p><?=$back?><a href="index_eng.php"><img src="images/cont_to_purchase.gif" width="161" height="19" border="0"></a></p>
            <p>&nbsp;</p>
    </td>
        </tr>
      </table>
      <p>&nbsp;</p></div>
			</td>
          </tr>
        </table></td>
      </tr>
      <tr>
          <td height="80" align="center" valign="bottom" bgcolor="#FFFFFF"><span class="s1">Copyright 
            &copy; 2004, All Rights Reserved by Jonesky Limited. <br>
            &nbsp;&nbsp; </span></td>
      </tr>
    </table></td>
  </tr>

</table>
</body>
</html>
<?
@mysql_close();
?>